package loveqq.niceexcel.read.handler;

import loveqq.niceexcel.read.ReadContext;
import org.apache.poi.ss.usermodel.Workbook;

/**
 * 读取监听器
 * <pre>{@code
 *
 *  WorkbookReadHandler handler;
 *  Workbook workbook = WorkbookFactory.create();
 *  // 读取workbook开始
 *  handler.onWorkbookBegin();
 *  for (Sheet sheet : workbook) {
 *      ......
 *  }
 *  // 读取workbook结束
 *  handler.onWorkbookEnd();
 *
 * }</pre>
 *
 * @author zhongjh@tsintergy.com
 * @date 2022-08-18
 */
public interface WorkbookReadHandler extends ReadHandler {
    /**
     * workbook获取后开始读取
     */
    default void onWorkbookBegin(ReadContext context, Workbook workbook) {
    }

    /**
     * workbook读取结束后
     */
    default void onWorkbookEnd(ReadContext context, Workbook workbook) {
    }
}
